import pymysql
conn=pymysql.connect(host="211.103.136.244", port=7061,
user="student", password="iHRM_student_2021",
database="test_db", charset="utf8")
cs=conn.cursor()
res=cs.execute("insert into t_book(title, pub_date) values('好好学习吧', '2022-01-02');")
print("影响的行数",res)
conn.commit()
conn.rollback()
cs.close()
conn.close()







